Android InApp SDK Integration
Download Android SDK Integration DEMO Android SDK DEMO
Currently, the SDK supports only the local AAR dependency mode
Android InApp SDK Integration to a payment originating form Merchant’s mobile app.
Quick Steps:
1. Download the EthiopiaPaySdkModule to the project app
EthiopiaPaySdkModule-uat-release.aar
2. Create a new libs folder in the project app (or other submodules), and copy the EthiopiaPaySdkModule-uat-release.aar file to the folder:
3. Add the following dependency to the build.gradle file:
dependencies {
implementation files(' libs/EthiopiaPaySdkModule-uat-release.aar')
}
4. The third-party app places an order on the SuperApp server, obtains the order information, and constructs the receiveCode field.
receiveCode={TELEBIRR}${BUYGOOD}${shortCode}${amount}${prepay_id}%{time}
receiveCode sample:TELEBIRR$BUYGOODS$500358$50.00$202307261139071684121154928791554$30
5. Then invoke the SDK API to start the payment.
final PayInfo payInfo = new PayInfo.Builder()
.setAppId(orderInfo.appId)
.setShortCode(orderInfo.shortCode)
.setReceiveCode(orderInfo.receiveCode)
.build();
PaymentManager.getInstance().pay(this, payInfo);
6. Listen to the payment callback.
PaymentManager.getInstance().setPayCallback(new PayCallback() {
@Override
public void onPayCallback(int code, String errMsg) {
Log.d(TAG, "onPayCallback: code "+ code +" errMsg " + errMsg);
Toast.makeText(App.this, code + errMsg, Toast.LENGTH_SHORT).show();
}
});
7. Error Code Description
Error Code Description
Error Code | Description |
---|---|
1 | Unknown error. |
2 | Parameter error. |
3 | Cancellation of payment |
10 | The Payment is not installed. |
11 | The current version of the Payment does not support this function. |
8. Add Obfuscation Rule
keep class com.huawei.ethiopia.pay.sdk.api.core.* {;}